home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (c) 1992 The Regents of the University of California.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice and the following
- * two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
- * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
- #include <math.h>
- #include "video.h"
- #include "proto.h"
- #include "dither.h"
-
- /* Range values for lum, cr, cb. */
- int LUM_RANGE;
- int CR_RANGE;
- int CB_RANGE;
-
- /* Array that remaps color numbers to actual pixel values used by X server. */
-
- unsigned char pixel[256];
-
- /* Arrays holding quantized value ranged for lum, cr, and cb. */
-
- int *lum_values;
- int *cr_values;
- int *cb_values;
-
-
- /* Array back mapping pixel value to color number. Used for debugging and dumping
- purposes.
- */
-
- static char backpixel[256];
-
-
-
- /*
- *--------------------------------------------------------------
- *
- * ExecuteDisplay --
- *
- * Actually displays display plane in previously created window.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *--------------------------------------------------------------
- */
-
- /***************************************************************
- vid_stream->current->display is a pointer to a bitmap of dimensions vid_stream->mb_width * 16
- by vid_stream->mb_height * 16. The RGB data are three bytes packed into the lower three
- bytes of an int for each pixel. - WAR
- ***************************************************************/
-
- void ExecuteDisplay(vid_stream)
- VidStream *vid_stream;
- {
- FILE *fp;
- char outFile[128];
- int iTemp;
-
- totNumFrames++;
- #ifdef ANALYSIS
- return;
- #endif
- fwrite((void *) &totNumFrames, (size_t) sizeof(int), (size_t) 1, stdout);
- #define BYTES_PER_PIXEL 3
- fwrite((void *) vid_stream->current->display, (size_t) sizeof(char),
- (size_t) (vid_stream->mb_width * 16 * vid_stream->mb_height * 16 * BYTES_PER_PIXEL), stdout);
- }
-